﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAO;

namespace BUS
{
    public class NhaCungCapBUS
    {
        public static List<NhaCungCapDTO> SelectAll()
        {
            return NhaCungCapDAO.SelectAll();
        }

        public static bool Delete_NVL_from_NCC(int ID_NCC_NVL)
        {
            return NguyenVatLieuDAO.Delete_NVL_from_NCC(ID_NCC_NVL);
        }

        public static List<NhaCungCapDTO> Search_by_TenNCC(string TenNCC)
        {
            try
            {
                return NhaCungCapDAO.Search_by_TenNCC(TenNCC);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static bool Insert(NhaCungCapDTO ncc)
        {
            return NhaCungCapDAO.Insert(ncc);
        }

        public static bool Delete(int MaNCC)
        {
            try
            {
                return NhaCungCapDAO.Delete(MaNCC);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            
        }

        public static bool Update(NhaCungCapDTO ncc)
        {
            try
            {
                return NhaCungCapDAO.Update(ncc);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
